package dao

import javax.inject.{Inject, Singleton}
import models.Tables._
import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfigProvider}
import slick.jdbc.JdbcProfile

import scala.concurrent.ExecutionContext.Implicits.global

/**
 * Created by yz on 2018/5/29
 */
@Singleton
class FusionSymbolsDao @Inject()(protected val dbConfigProvider: DatabaseConfigProvider) extends
  HasDatabaseConfigProvider[JdbcProfile] {

  import profile.api._

  def deleteAll = db.run(FusionSymbols.delete).map(_ => ())

  def insert(row: FusionSymbolsRow) = db.run(FusionSymbols += row).map(_ => ())

  def select = db.run(FusionSymbols.filter(_.id === 1).result.head)


}
